var i=0;
function timedCount(){
    i+=1;
    postMessage(i);
    setTimeout("timedCount()",500)
}
timedCount()